﻿<extend name="Public:base" />
<block name="title"><title>{$prjInfo.tname}-般若虾</title></block>
<block name="header_styles">
    <style type="text/css">
        .link-favorite {
            position: relative;
            z-index: 9;
        }
    </style>

</block>
<block name="main">

    <div class="row">
        <div class="col-xs-9">
            <div class="column-main">
                <div class="section">
                    <div class="section-title">
                        <a href="{:U('Project/detail@'.getDomain(),array('id'=>$prjInfo['id']))}" class="pull-right"><i class="fa fa-search"></i> 查看项目</a>
                        <span>{$prjInfo.tname}</span>
                    </div>
                    <div class="section-content">
                        <volist name='jobs' id="vo">
                            <div class="job-item">
                                <div class="basic-info-sub-title">
                                    <div class="pull-right">
                                        
                                        <if condition='$vo.faved gt 0'>
                                            <a href="javascript:void(0);" class="favbtn" data-job="{$vo.id}" data-ftype="2">
                                                <i class="fa fa-heart red"></i>&nbsp;{$vo.fc}
                                            </a>
                                            <else />
                                            <a href="javascript:void(0);" class="favbtn" data-job="{$vo.id}" data-ftype="1">
                                                <i class="fa fa-heart "></i>&nbsp;{$vo.fc}
                                            </a>
                                        </if>
                                        <if condition="$vo['num'] gt $vo['datastate']">
                                            <span class="postnum">剩余{$vo['num']-$vo['datastate']} 席</span>
                                            <eq name='vo.applied' value='1'>
                                                <a href="javascript:void(0);" data-id="{$vo.id}" class="btn btn-green">撤销应聘</a>
                                            <else />
                                                <eq name="vo.moneyin" value="2">
                                                <a href="javascript:;" class="graybtn">应聘</a>
                                                <else />
                                                <a href="javascript:void(0);" data-uid="{$uid|default=0}" data-pid="{$pid}" data-did="{$vo.did}" data-id="{$vo.id}" class="btn btn-green button-shenqing">应聘</a>
                                                </eq>
                                            </eq>
                                        <else />
                                            <a href='javascript:void(0);' class="graybtn">满员</a>
                                        </if>
                                    </div>
                                    <span>{$vo.name}</span>
                                    <span style="font-size:0.5em;color: #888;">已有</span><span style="font-weight: bold;font-size:0.5em;color: #111;">{$vo.aplc}</span><span style="font-size:0.5em;color: #888;">人应聘</span>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="solution-description">
                                    <span style="color: #111;">报酬：</span><br />
                                    <if condition="$vo['instalment'] eq 1">
                                        单期&nbsp;&#165;{$vo.salary}&nbsp;<a href="javascript:void(0);" class="tuo-guang <gt name='vo.moneyin' value='0'>active</gt>">{$vo.moneyin|toTuoguanDesc}</a>
                                    <elseif condition="$vo['instalment'] eq 2"/>
                                    分期<br/>
                                    <volist name="vo['instals']" id='instal' key='i'>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第{$i}期&nbsp;{$instal['amount']}&nbsp;<a href="javascript:void(0);" class="tuo-guang <gt name="vo['moneyin']" value='0'>active</gt>">{$vo.moneyin|toTuoguanDesc}</a><br/>
                                    </volist>
                                    </if>
                                    <br />
                                    <span style="color: #111;">工作内容：</span><br />
                                    {$vo.zhize|htmlspecialchars_decode}
                                    <br />
                                </div>
                            </div>
                        </volist>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-3">
            <div class="column-sidebar">
                <div class='prjdetailsidebar-title'><p>项目所属团队</p></div>
                <if condition="$prjInfo.state gt 0">
                    <div class="widget-userinfo">
                        <div class="text-center">
                            <img src="__APP__/{$prjInfo.logo|toLogo}" alt="{$prjInfo.tname}" class="img-thumbnail" />
                        </div>
                        <ul class="list-project-info">
                            <li><strong>团队名称：</strong>{$prjInfo.tname}</li>
                            <li><strong>创建者：</strong><a href="{$prjInfo.uid|genTalentURL}">{$prjInfo.creater}</a></li>
                            <li><strong>招募席位：</strong>{$jobTotal}</li>
                            <li><strong>剩余席位：</strong>{$rest}</li>
                        </ul>
                    </div>
                    <div class="panel panel-menu">
                        <div class="panel-heading">
                            <span class="badge transparent pull-right">{$jobTotal-$rest}/{$jobTotal}</span>
                            已有成员
                        </div>
                        <div class="panel-body">
                            <ul class="list-project-members">
                                <empty name='jobUsers'>
                                    <li class="group-member-item nohover">
                                        <span>暂无成员</span>
                                    </li>
                                    <else />
                                    <volist name="jobUsers" id="vo">
                                        <li class="group-member-item nohover">
                                            <a href="{$vo.uid|genTalentURL}" class="member-pic">
                                                <img src="__APP__/{$vo.photo|toTalentPhoto}" alt="{$vo.uname}" width="75" height="75" class="img-responsive avatar-round" />
                                            </a>
                                            <div class="member-details">
                                                <label class="text-warning">{$vo.jname}</label><br />
                                                <label><a href="{$vo.uid|genTalentURL}" class="text-success">{$vo.nickname}</a></label>
                                            </div>
                                        </li>
                                    </volist>
                                </empty>
                            </ul>
                        </div>
                    </div>
                    <div class="panel panel-menu">
                        <div class="panel-heading">
                            社交帐号
                        </div>
                        <div class="panel-body">
                            <ul>
                                <li><span>微博：{$prjInfo.weibo}</span></li>
                                <li><span>微信公众号：{$prjInfo.weixin}</span></li>
                            </ul>
                        </div>
                    </div>
                </if>
            </div>
        </div>
    </div>
    <div style="display: none;">
        <div id="tooltipcontent1" class="tooltipcontent1">
            <div style="width:300px;text-align:left;">
                {$tip}
            </div>
        </div>
    </div>
</block>
<block name="footer_scripts">
    <!--<script  type="text/javascript" src="__Public__/js/jobfav.js"></script>-->
    <if condition="$account.passcheck neq 0">
        <script type="text/javascript">
            require(["jquery", "modules/message"], function ($, boroshare) {
                //申请
                $(".button-shenqing").on("click", function () {
                    var uid = $(this).data("uid");
                    var pid = $(this).data("pid");
                    var did = $(this).data("did");
                    var id = $(this).data("id");
                    if (uid <= 0) {
                        $.fancybox.open("#loginbox_global", { autoSize: true, padding: 0, closeBtn: false });
                        return false;
                    }
                    var url1 = "{:U('Project/if_ajax@'.getDomain(), '', '')}-prj-" + pid + "-job-" + id;
                    var url = "{:U('Project/sq_ajax@'.getDomain(), '', '')}-prj-" + pid + "-job-" + id;
                    $.ajax({
                        type: "get",
                        async: false,
                        url: url1,
                        dataType: "jsonp",
                        jsonp: "callback",//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
                        jsonpCallback: "callme",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
                        success: function (data) {
                            if (data.success == 0) {
                                $.ajax({
                                    type: "get",
                                    async: false,
                                    url: url,
                                    dataType: "jsonp",
                                    jsonp: "callback",//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
                                    jsonpCallback: "callme",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
                                    success: function (data) {
                                        boroshare.alert({ content: data.msg, sure: function () { window.location.reload(); } });
                                    },
                                    error: function () {
                                        boroshare.alert({ content: "查询失败!" });
                                    }
                                });
                            }
                            else if (data.success == 1) {
                                window.location.href = "{:U('Login/index@'.getDomain())}";
                            }
                            else {
                                boroshare.alert({ content: data.msg });
                            }
                        },
                        error: function () {
                            boroshare.alert({ content: "查询失败!" });
                        }
                    });
                    return false;
                });
                //撤销申请
                $(".button-cancelapply").on("click", function () {
                    var id = $(this).data("id");
                    var url = "{:U('Project/cancelapply_ajax@'.getDomain(), '', '')}-job-" + id;
                    $.ajax({
                        type: "get",
                        async: false,
                        url: url,
                        dataType: "jsonp",
                        jsonp: "callback",//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
                        jsonpCallback: "callme",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
                        success: function (data) {
                            if (data.success == 1) {
                                boroshare.alert({ content: data.msg, sure: function () { window.location.reload(); } });
                            }
                            else {
                                boroshare.alert({ content: data.msg });
                            }
                        },
                        error: function () {
                            boroshare.alert({ content: "查询失败!" });
                        }
                    });
                });
            });
        </script>
        <else />
        <script type="text/javascript">
            require(["jquery", "modules/message"], function ($, boroshare) {
                $(".button-shenqing").on("click", function () {
                    var uid = $(this).data("uid");
                    if (uid <= 0) {
                        $.fancybox.open("#loginbox_global", { autoSize: true, padding: 0, closeBtn: false });
                        return false;
                    }
                    boroshare.alert({ content: "很遗憾，您的账号尚未通过我们的人工审核，暂时无法加入团队。您可以到 <a href=\"{:U('User/info@'.getDomain())}\" style=\"text-decoration:underline\"><b>用户中心</b></a> 催促加快审核。" });
                });
            });
        </script>
    </if>
    <if condition="$uid gt 0">
        <else />
        <script type="text/javascript">
            //setPara({'before':function(self){
            //        showLoginForm_centre();
            //        return false;
            //    }
            //});
        </script>
    </if>

    <script type="text/javascript">
        require(["modules/jobfav"], function (jobfav) {
            var isLogged = parseInt('{$uid!=null?1:0}');
            jobfav.init(isLogged);
        });
    </script>

</block>
